home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / fretext1.sit / Free Text Browser v1.01 / background_2734.txt < prev    next >
Text File  |  1990-04-13  |  34KB  |  1,340 lines

  1. -- background: 2734 from stack: in.01
  2. -- bmap block id: 3197
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: BrowserBg
  6. ----- HyperTalk script -----
  7. on openCard -- make sure subset buttons are right for this card
  8.   put getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty into noSub1
  9.   put getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty into noSub2
  10.   if noSub1 and noSub2 then -- no subsets active on this card
  11.     hide bg button "and subsets"
  12.     hide bg button "or subsets"
  13.     hide bg button "not subset 1"
  14.     hide bg button "not subset 2"
  15.     hide bg button "fill subset 1"
  16.     hide bg button "fill subset 2"
  17.   else if noSub1 then -- only subset 2 active on this card
  18.     hide bg button "and subsets"
  19.     hide bg button "or subsets"
  20.     hide bg button "not subset 1"
  21.     hide bg button "fill subset 1"
  22.     show bg button "fill subset 2"
  23.     show bg button "not subset 2"
  24.   else if noSub2 then -- only subset 1 active on this card
  25.     hide bg button "and subsets"
  26.     hide bg button "or subsets"
  27.     hide bg button "not subset 2"
  28.     hide bg button "fill subset 2"
  29.     show bg button "fill subset 1"
  30.     show bg button "not subset 1"
  31.   else                -- both subsets 1 and 2 active on this card
  32.     show bg button "fill subset 1"
  33.     show bg button "fill subset 2"
  34.     show bg button "not subset 1"
  35.     show bg button "not subset 2"
  36.     show bg button "or subsets"
  37.     show bg button "and subsets"
  38.   end if
  39. end openCard
  40.  
  41. on closeCard -- tidy up when leaving...
  42.   if the height of field "Text" > 169 then
  43.     send mouseUp to bg button id 44
  44.   end if
  45.   hide field "searchPattern1"
  46.   hide field "searchPattern2"
  47. end closeCard
  48.  
  49.  
  50. -- part 15 (button)
  51. -- low flags: 00
  52. -- high flags: 0000
  53. -- rect: left=233 top=0 right=22 bottom=255
  54. -- title width / last selected line: 0
  55. -- icon id / first selected line: 29514 / 29514
  56. -- text alignment: 1
  57. -- font id: 0
  58. -- text size: 12
  59. -- style flags: 0
  60. -- line height: 16
  61. -- part name: empty subset 1
  62. ----- HyperTalk script -----
  63. on mouseUp
  64.   if the OptionKey is down then
  65.     show field "SearchPattern1"
  66.   else if the CommandKey is down then
  67.     ask "Proximity range (bytes)?" with 48
  68.     setNeighborhoodSize It -- reset neighborhood for proximity search
  69.   else -- empty the subset associated with Index field #1
  70.     checkOpenDatabase
  71.     if not (getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty) then
  72.       get zbrowser ("RELEASESUBSET", getSubsetHandle(1))
  73.     end if
  74.     setSubsetHandle 1,zbrowser("NEWSUBSET",getTextFileRefNum())
  75.     get zbrowser ("EMPTYSUBSET", getSubsetHandle(1))
  76.     browseIndex1
  77.     put empty into field "SearchPattern1"
  78.     show field "SearchPattern1"
  79.     show bg button "fill subset 1"
  80.     show bg button "not subset 1"
  81.     if the visible of bg button "fill subset 2" then
  82.       show bg button "or subsets"
  83.       show bg button "and subsets"
  84.     end if
  85.   end if
  86. end mouseUp
  87.  
  88.  
  89.  
  90. -- part 20 (button)
  91. -- low flags: 00
  92. -- high flags: 0000
  93. -- rect: left=257 top=0 right=22 bottom=279
  94. -- title width / last selected line: 0
  95. -- icon id / first selected line: 29514 / 29514
  96. -- text alignment: 1
  97. -- font id: 0
  98. -- text size: 12
  99. -- style flags: 0
  100. -- line height: 16
  101. -- part name: empty subset 2
  102. ----- HyperTalk script -----
  103. on mouseUp
  104.   if the OptionKey is down then
  105.     show field "SearchPattern2"
  106.   else if the CommandKey is down then
  107.     ask "Proximity range (bytes)?" with 48
  108.     setNeighborhoodSize It -- reset neighborhood for proximity search
  109.   else -- empty the subset associated with Index field #2
  110.     checkOpenDatabase
  111.     if not (getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty) then
  112.       get zbrowser ("RELEASESUBSET", getSubsetHandle(2))
  113.     end if
  114.     setSubsetHandle 2,zbrowser("NEWSUBSET",getTextFileRefNum())
  115.     get zbrowser ("EMPTYSUBSET", getSubsetHandle(2))
  116.     browseIndex2
  117.     put empty into field "SearchPattern2"
  118.     show field "SearchPattern2"
  119.     show bg button "fill subset 2"
  120.     show bg button "not subset 2"
  121.     if the visible of bg button "fill subset 1" then
  122.       show bg button "or subsets"
  123.       show bg button "and subsets"
  124.     end if
  125.   end if
  126. end mouseUp
  127.  
  128.  
  129.  
  130. -- part 39 (button)
  131. -- low flags: 00
  132. -- high flags: 2002
  133. -- rect: left=493 top=157 right=177 bottom=512
  134. -- title width / last selected line: 0
  135. -- icon id / first selected line: 22489 / 22489
  136. -- text alignment: 1
  137. -- font id: 0
  138. -- text size: 12
  139. -- style flags: 0
  140. -- line height: 16
  141. -- part name: pageDownContext
  142. ----- HyperTalk script -----
  143. on mouseDown
  144.   global contextLines
  145.   checkOpenDatabase
  146.   if line contextLines of field Context is empty then exit mouseDown
  147.   setInstanceNum getTextPtrListInstanceItem (contextLines)
  148.   browseContext 1
  149.   setInstanceNum getTextPtrListInstanceItem (1)
  150. end mouseDown
  151.  
  152. on mouseStillDown
  153.   global contextLines
  154.   if line contextLines of field Context is empty then exit mouseStillDown
  155.   setInstanceNum getTextPtrListInstanceItem (contextLines)
  156.   browseContext 1
  157.   setInstanceNum getTextPtrListInstanceItem (1)
  158. end mouseStillDown
  159.  
  160.  
  161.  
  162. -- part 38 (button)
  163. -- low flags: 00
  164. -- high flags: 2002
  165. -- rect: left=493 top=119 right=143 bottom=512
  166. -- title width / last selected line: 0
  167. -- icon id / first selected line: 22489 / 22489
  168. -- text alignment: 1
  169. -- font id: 0
  170. -- text size: 12
  171. -- style flags: 0
  172. -- line height: 16
  173. -- part name: pageUpContext
  174. ----- HyperTalk script -----
  175. on mouseDown
  176.   global contextLines
  177.   checkOpenDatabase
  178.   if line 1 of field Context is empty then exit mouseDown
  179.   browseContext contextLines
  180.   setInstanceNum getTextPtrListInstanceItem (1)
  181. end mouseDown
  182.  
  183. on mouseStillDown
  184.   global contextLines
  185.   if line 1 of field Context is empty then exit mouseStillDown
  186.   browseContext contextLines
  187.   setInstanceNum getTextPtrListInstanceItem (1)
  188. end mouseStillDown
  189.  
  190.  
  191.  
  192. -- part 33 (button)
  193. -- low flags: 00
  194. -- high flags: 2002
  195. -- rect: left=213 top=71 right=90 bottom=233
  196. -- title width / last selected line: 0
  197. -- icon id / first selected line: 22489 / 22489
  198. -- text alignment: 1
  199. -- font id: 0
  200. -- text size: 12
  201. -- style flags: 0
  202. -- line height: 16
  203. -- part name: pageDownIndex1
  204. ----- HyperTalk script -----
  205. on mouseDown
  206.   global indexLines
  207.   checkOpenDatabase
  208.   if line indexLines of field index1 is empty then
  209.     beep
  210.     exit mouseDown
  211.   end if
  212.   setWordNum1 (getWordNum1() + indexLines - 1)
  213.   browseIndex1
  214. end mouseDown
  215.  
  216. on mouseStillDown
  217.   global indexLines
  218.   if line indexLines of field index1 is empty then
  219.     beep
  220.     exit mouseStillDown
  221.   end if
  222.   setWordNum1 (getWordNum1() + indexLines - 1)
  223.   browseIndex1
  224. end mouseStillDown
  225.  
  226.  
  227.  
  228. -- part 25 (button)
  229. -- low flags: 00
  230. -- high flags: 2002
  231. -- rect: left=213 top=34 right=57 bottom=233
  232. -- title width / last selected line: 0
  233. -- icon id / first selected line: 22489 / 22489
  234. -- text alignment: 1
  235. -- font id: 0
  236. -- text size: 12
  237. -- style flags: 0
  238. -- line height: 16
  239. -- part name: pageUpIndex1
  240. ----- HyperTalk script -----
  241. on mouseDown
  242.   global indexLines
  243.   checkOpenDatabase
  244.   get getWordNum1() - indexLines + 1
  245.   if It < 0 then
  246.     beep
  247.     put 0 into It
  248.   end if
  249.   setWordNum1 It
  250.   browseIndex1
  251. end mouseDown
  252.  
  253. on mouseStillDown
  254.   global indexLines
  255.   get getWordNum1() - indexLines + 1
  256.   if It < 0 then
  257.     beep
  258.     put 0 into It
  259.   end if
  260.   setWordNum1 It
  261.   browseIndex1
  262. end mouseStillDown
  263.  
  264.  
  265.  
  266. -- part 35 (button)
  267. -- low flags: 00
  268. -- high flags: 2002
  269. -- rect: left=492 top=34 right=57 bottom=512
  270. -- title width / last selected line: 0
  271. -- icon id / first selected line: 22489 / 22489
  272. -- text alignment: 1
  273. -- font id: 0
  274. -- text size: 12
  275. -- style flags: 0
  276. -- line height: 16
  277. -- part name: pageUpIndex2
  278. ----- HyperTalk script -----
  279. on mouseDown
  280.   global indexLines
  281.   checkOpenDatabase
  282.   get getWordNum2() - indexLines + 1
  283.   if It < 0 then
  284.     beep
  285.     put 0 into It
  286.   end if
  287.   setWordNum2 It
  288.   browseIndex2
  289. end mouseDown
  290.  
  291. on mouseStillDown
  292.   global indexLines
  293.   get getWordNum2() - indexLines + 1
  294.   if It < 0 then
  295.     beep
  296.     put 0 into It
  297.   end if
  298.   setWordNum2 It
  299.   browseIndex2
  300. end mouseStillDown
  301.  
  302.  
  303.  
  304. -- part 36 (button)
  305. -- low flags: 00
  306. -- high flags: 2002
  307. -- rect: left=493 top=71 right=90 bottom=512
  308. -- title width / last selected line: 0
  309. -- icon id / first selected line: 22489 / 22489
  310. -- text alignment: 1
  311. -- font id: 0
  312. -- text size: 12
  313. -- style flags: 0
  314. -- line height: 16
  315. -- part name: pageDownIndex2
  316. ----- HyperTalk script -----
  317. on mouseDown
  318.   global indexLines
  319.   checkOpenDatabase
  320.   if line indexLines of field index2 is empty then
  321.     beep
  322.     exit mouseDown
  323.   end if
  324.   setWordNum2 (getWordNum2() + indexLines - 1)
  325.   browseIndex2
  326. end mouseDown
  327.  
  328. on mouseStillDown
  329.   global indexLines
  330.   if line indexLines of field index2 is empty then
  331.     beep
  332.     exit mouseStillDown
  333.   end if
  334.   setWordNum2 (getWordNum2() + indexLines - 1)
  335.   browseIndex2
  336. end mouseStillDown
  337.  
  338.  
  339.  
  340. -- part 31 (button)
  341. -- low flags: 00
  342. -- high flags: 2002
  343. -- rect: left=495 top=88 right=104 bottom=512
  344. -- title width / last selected line: 0
  345. -- icon id / first selected line: 20407 / 20407
  346. -- text alignment: 1
  347. -- font id: 0
  348. -- text size: 12
  349. -- style flags: 0
  350. -- line height: 16
  351. -- part name: scrollDownIndex2
  352. ----- HyperTalk script -----
  353. on mouseDown
  354.   global indexLines
  355.   checkOpenDatabase
  356.   if line indexLines of field Index2 is empty then
  357.     beep
  358.     exit mouseDown
  359.   end if
  360.   setWordNum2 (getWordNum2() + 1)
  361.   browseIndex2
  362. end mouseDown
  363.  
  364. on mouseStillDown
  365.   global indexLines
  366.   if line indexLines of field Index2 is empty then
  367.     beep
  368.     exit mouseStillDown
  369.   end if
  370.   setWordNum2 (getWordNum2() + 2)
  371.   browseIndex2
  372. end mouseStillDown
  373.  
  374.  
  375.  
  376. -- part 32 (button)
  377. -- low flags: 00
  378. -- high flags: 2002
  379. -- rect: left=496 top=56 right=72 bottom=512
  380. -- title width / last selected line: 0
  381. -- icon id / first selected line: 15717 / 15717
  382. -- text alignment: 1
  383. -- font id: 0
  384. -- text size: 12
  385. -- style flags: 0
  386. -- line height: 16
  387. -- part name: jumpIndex2
  388. ----- HyperTalk script -----
  389. on mouseUp
  390.   checkOpenDatabase
  391.   ask "Word to jump to?"
  392.   if It is empty then exit to HyperCard
  393.   lock screen
  394.   setWordNum2 (line 1 of zbrowser ("LOCATE", It, getKeyFileRefNum()))
  395.   if getWordNum2() < 0 then setWordNum2(0)
  396.   browseIndex2
  397. end mouseUp
  398.  
  399.  
  400.  
  401.  
  402. -- part 30 (button)
  403. -- low flags: 00
  404. -- high flags: 2002
  405. -- rect: left=495 top=19 right=35 bottom=512
  406. -- title width / last selected line: 0
  407. -- icon id / first selected line: 24019 / 24019
  408. -- text alignment: 1
  409. -- font id: 0
  410. -- text size: 12
  411. -- style flags: 0
  412. -- line height: 16
  413. -- part name: scrollUpIndex2
  414. ----- HyperTalk script -----
  415. on mouseDown
  416.   checkOpenDatabase
  417.   get getWordNum2() - 1
  418.   if It < 0 then
  419.     beep
  420.     put 0 into It
  421.   end if
  422.   setWordNum2 It
  423.   browseIndex2
  424. end mouseDown
  425.  
  426. on mouseStillDown
  427.   get getWordNum2() - 2
  428.   if It < 0 then
  429.     beep
  430.     put 0 into It
  431.   end if
  432.   setWordNum2 It
  433.   browseIndex2
  434. end mouseStillDown
  435.  
  436.  
  437.  
  438. -- part 34 (button)
  439. -- low flags: 00
  440. -- high flags: 2002
  441. -- rect: left=216 top=19 right=35 bottom=233
  442. -- title width / last selected line: 0
  443. -- icon id / first selected line: 24019 / 24019
  444. -- text alignment: 1
  445. -- font id: 0
  446. -- text size: 12
  447. -- style flags: 0
  448. -- line height: 16
  449. -- part name: scrollUpIndex1
  450. ----- HyperTalk script -----
  451. on mouseDown
  452.   checkOpenDatabase
  453.   get getWordNum1() - 1
  454.   if It < 0 then
  455.     beep
  456.     put 0 into It
  457.   end if
  458.   setWordNum1 It
  459.   browseIndex1
  460. end mouseDown
  461.  
  462. on mouseStillDown
  463.   get getWordNum1() - 2
  464.   if It < 0 then
  465.     beep
  466.     put 0 into It
  467.   end if
  468.   setWordNum1 It
  469.   browseIndex1
  470. end mouseStillDown
  471.  
  472.  
  473.  
  474. -- part 12 (button)
  475. -- low flags: 00
  476. -- high flags: 2002
  477. -- rect: left=217 top=56 right=72 bottom=233
  478. -- title width / last selected line: 0
  479. -- icon id / first selected line: 15717 / 15717
  480. -- text alignment: 1
  481. -- font id: 0
  482. -- text size: 12
  483. -- style flags: 0
  484. -- line height: 16
  485. -- part name: jumpIndex1
  486. ----- HyperTalk script -----
  487. on mouseUp
  488.   checkOpenDatabase
  489.   ask "Word to jump to?"
  490.   if It is empty then exit to HyperCard
  491.   lock screen
  492.   setWordNum1 (line 1 of zbrowser ("LOCATE", It, getKeyFileRefNum()))
  493.   if getWordNum1() < 0 then setWordNum1(0)
  494.   browseIndex1
  495. end mouseUp
  496.  
  497.  
  498.  
  499.  
  500. -- part 3 (field)
  501. -- low flags: 01
  502. -- high flags: 0002
  503. -- rect: left=279 top=19 right=104 bottom=496
  504. -- title width / last selected line: 0
  505. -- icon id / first selected line: 0 / 0
  506. -- text alignment: 0
  507. -- font id: 4
  508. -- text size: 9
  509. -- style flags: 0
  510. -- line height: 12
  511. -- part name: Index2
  512. ----- HyperTalk script -----
  513. on mouseUp
  514.   global whichSubset
  515.   put ShiftKey() into shifty
  516.   put OptionKey() into opty
  517.   checkOpenDatabase -- make sure files are open
  518.   set cursor to watch
  519.   lock screen
  520.   put clickedLineNum() into clickedLine
  521.   if shifty is down and getSubsetHandle(2) is not 0 then
  522.     -- must add or subtract word from subset
  523.     show field "SearchPattern2"
  524.     if opty is down then -- subtract the word
  525.       put " and not " & last word of line clickedLine of field "Index2" after field "SearchPattern2"
  526.       get zbrowser ("SETSUBSETBITS", clickedLine + getWordNum2() - 1, getNeighborhoodSize(), 0, getKeyFileRefNum(), getPtrFileRefNum(), getSubsetHandle(2))
  527.     else -- add the word
  528.       if field "SearchPattern2" is not empty then
  529.         put " or " after field "searchPattern2"
  530.       end if
  531.       put last word of line clickedLine of field "Index2" after field "SearchPattern2"
  532.       get zbrowser ("SETSUBSETBITS", clickedLine + getWordNum2() - 1, getNeighborhoodSize(), 1, getKeyFileRefNum(), getPtrFileRefNum(), getSubsetHandle(2))
  533.     end if
  534.     browseIndex2
  535.   else
  536.     --must retrieve clicked word
  537.     put getInstanceList2item (clickedLine) into instanceNum
  538.     if instanceNum is empty then
  539.       beep
  540.       answer "Sorry, nothing to retrieve!"
  541.       exit to HyperCard
  542.     end if
  543.     setInstanceNum instanceNum
  544.     put 2 into whichSubset
  545.     browseContext 1
  546.   end if
  547. end mouseUp
  548.  
  549.  
  550.  
  551. -- part 1 (field)
  552. -- low flags: 01
  553. -- high flags: 0002
  554. -- rect: left=0 top=19 right=104 bottom=217
  555. -- title width / last selected line: 0
  556. -- icon id / first selected line: 0 / 0
  557. -- text alignment: 0
  558. -- font id: 4
  559. -- text size: 9
  560. -- style flags: 0
  561. -- line height: 12
  562. -- part name: Index1
  563. ----- HyperTalk script -----
  564. on mouseUp
  565.   global whichSubset
  566.   put ShiftKey() into shifty
  567.   put OptionKey() into opty
  568.   checkOpenDatabase -- make sure files are open
  569.   set cursor to watch
  570.   lock screen
  571.   put clickedLineNum() into clickedLine
  572.   if shifty is down and getSubsetHandle(1) is not 0 then
  573.     -- must add or subtract word from subset
  574.     show field "SearchPattern1"
  575.     if opty is down then -- subtract the word
  576.       put " and not " & last word of line clickedLine of field "Index1" after field "SearchPattern1"
  577.       get zbrowser ("SETSUBSETBITS", clickedLine + getWordNum1() - 1, getNeighborhoodSize(), 0, getKeyFileRefNum(), getPtrFileRefNum(), getSubsetHandle(1))
  578.     else -- add the word
  579.       if field "SearchPattern1" is not empty then
  580.         put " or " after field "searchPattern1"
  581.       end if
  582.       put last word of line clickedLine of field "Index1" after field "SearchPattern1"
  583.       get zbrowser ("SETSUBSETBITS", clickedLine + getWordNum1() - 1, getNeighborhoodSize(), 1, getKeyFileRefNum(), getPtrFileRefNum(), getSubsetHandle(1))
  584.     end if
  585.     browseIndex1
  586.   else
  587.     --must retrieve clicked word
  588.     put getInstanceList1item (clickedLine) into instanceNum
  589.     if instanceNum is empty then
  590.       beep
  591.       answer "Sorry, nothing to retrieve!"
  592.       exit to HyperCard
  593.     end if
  594.     setInstanceNum instanceNum
  595.     put 1 into whichSubset
  596.     browseContext 1
  597.   end if
  598. end mouseUp
  599.  
  600.  
  601.  
  602. -- part 4 (field)
  603. -- low flags: 01
  604. -- high flags: 0002
  605. -- rect: left=0 top=104 right=189 bottom=496
  606. -- title width / last selected line: 0
  607. -- icon id / first selected line: 0 / 0
  608. -- text alignment: 0
  609. -- font id: 4
  610. -- text size: 9
  611. -- style flags: 0
  612. -- line height: 12
  613. -- part name: Context
  614. ----- HyperTalk script -----
  615. on mouseUp
  616.   global textChunkSize, textOffset, contextLineLength
  617.   set cursor to watch
  618.   checkOpenDatabase -- make sure files are open
  619.   lock screen
  620.   put clickedLineNum() into clickedLine
  621.   put getTextPtrListPtrItem(clickedLIne) into textPtr
  622.   if textPtr < 0 then
  623.     beep
  624.     answer "Sorry, nothing to retrieve!"
  625.     exit to HyperCard
  626.   end if
  627.   hide field "SearchPattern1"
  628.   hide field "SearchPattern2"
  629.   get zbrowser ("TEXT", textPtr, textChunkSize, textOffset, getTextFileRefNum())
  630.   put number of lines of It into textItemLines
  631.   put line 1 to (textItemLines-1) of It into field "Text"
  632.   put line textItemLines of It into textLastLine
  633.   setTextStart (word 1 of textLastLine)
  634.   setTextTarget (word 2 of textLastLine)
  635.   setTextEnd (word 3 of textLastLine)
  636.   -- following handles highlighting of target word....
  637.   put getTextTarget() into startSelection
  638.   get char startSelection to startSelection+contextLineLength of field Text
  639.   put startSelection+(the length of word 1 of It)-1 into endSelection
  640.   set the scroll of field Text to 0
  641.   select char startSelection to endSelection of field Text
  642.   get the rect of field Text
  643.   -- so we can display highlighted word nicely, need to fake a page-down
  644.   put (item 3 of It) - 8 into pageDownTextX
  645.   put (item 4 of It) - 16 into pageDownTextY
  646.   click at pageDownTextX,pageDownTextY
  647.   set the lockScreen to false
  648.   select char startSelection to endSelection of field Text
  649. end mouseUp
  650.  
  651.  
  652.  
  653. -- part 11 (field)
  654. -- low flags: 80
  655. -- high flags: 0007
  656. -- rect: left=234 top=62 right=184 bottom=423
  657. -- title width / last selected line: 0
  658. -- icon id / first selected line: 0 / 0
  659. -- text alignment: 0
  660. -- font id: 4
  661. -- text size: 9
  662. -- style flags: 0
  663. -- line height: 12
  664. -- part name: FTvars
  665.  
  666.  
  667. -- part 16 (button)
  668. -- low flags: 80
  669. -- high flags: 0000
  670. -- rect: left=233 top=20 right=42 bottom=255
  671. -- title width / last selected line: 0
  672. -- icon id / first selected line: 29513 / 29513
  673. -- text alignment: 1
  674. -- font id: 0
  675. -- text size: 12
  676. -- style flags: 0
  677. -- line height: 16
  678. -- part name: fill subset 1
  679. ----- HyperTalk script -----
  680. on mouseUp
  681.   -- fill the subset associated with Index field #1
  682.   checkOpenDatabase
  683.   if not (getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty) then
  684.     get zbrowser ("RELEASESUBSET", getSubsetHandle(1))
  685.     setSubsetHandle 1,0
  686.   end if
  687.   browseIndex1
  688.   hide field "searchPattern1"
  689.   hide bg button "and subsets"
  690.   hide bg button "or subsets"
  691.   hide bg button "not subset 1"
  692.   hide bg button "fill subset 1"
  693. end mouseUp
  694.  
  695.  
  696.  
  697.  
  698. -- part 17 (button)
  699. -- low flags: 80
  700. -- high flags: 0000
  701. -- rect: left=233 top=40 right=62 bottom=255
  702. -- title width / last selected line: 0
  703. -- icon id / first selected line: 29515 / 29515
  704. -- text alignment: 1
  705. -- font id: 0
  706. -- text size: 12
  707. -- style flags: 0
  708. -- line height: 16
  709. -- part name: not subset 1
  710. ----- HyperTalk script -----
  711. on mouseUp
  712.   -- invert the subset associated with Index field #1
  713.   checkOpenDatabase
  714.   if (getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty) then
  715.     beep
  716.     answer "Sorry, subset not open!"
  717.     exit to HyperCard
  718.   else
  719.     get zbrowser ("BOOLEANNOTSUBSET", getSubsetHandle(1))
  720.   end if
  721.   browseIndex1
  722.   if the number of words in field "SearchPattern1" > 1 then
  723.     put "not (" before field "SearchPattern1"
  724.     put ")" after field "SearchPattern1"
  725.   else
  726.     put "not " before field "SearchPattern1"
  727.   end if
  728.   show field "SearchPattern1"
  729. end mouseUp
  730.  
  731.  
  732.  
  733.  
  734. -- part 18 (button)
  735. -- low flags: 80
  736. -- high flags: 0000
  737. -- rect: left=240 top=61 right=83 bottom=271
  738. -- title width / last selected line: 0
  739. -- icon id / first selected line: 29518 / 29518
  740. -- text alignment: 1
  741. -- font id: 0
  742. -- text size: 12
  743. -- style flags: 0
  744. -- line height: 16
  745. -- part name: or subsets
  746. ----- HyperTalk script -----
  747. on mouseUp
  748.   -- union (Boolean OR) subsets
  749.   checkOpenDatabase
  750.   if (getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty or getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty) then
  751.     beep
  752.     answer "Sorry, subset not open!"
  753.     exit to HyperCard
  754.   end if
  755.   if clickedOnLeftHalf() then
  756.     get zbrowser ("ORSUBSETS", getSubsetHandle(1), getSubsetHandle(2))
  757.     browseIndex1
  758.     if field "SearchPattern1" is empty then
  759.       put field "SearchPattern2" into field "SearchPattern1"
  760.     else
  761.       if the number of words in field "SearchPattern2" > 1 then
  762.         put " or (" & field "SearchPattern2" & ")" after field "SearchPattern1"
  763.       else
  764.         put " or " & field "SearchPattern2" after field "SearchPattern1"
  765.       end if
  766.     end if
  767.   else
  768.     get zbrowser ("ORSUBSETS", getSubsetHandle(2), getSubsetHandle(1))
  769.     browseIndex2
  770.     if field "SearchPattern2" is empty then
  771.       put field "SearchPattern1" into field "SearchPattern2"
  772.     else
  773.       if the number of words in field "SearchPattern1" > 1 then
  774.         put " or (" & field "SearchPattern1" & ")" after field "SearchPattern2"
  775.       else
  776.         put " or " & field "SearchPattern1" after field "SearchPattern2"
  777.       end if
  778.     end if
  779.   end if
  780. end mouseUp
  781.  
  782.  
  783.  
  784.  
  785. -- part 19 (button)
  786. -- low flags: 80
  787. -- high flags: 0000
  788. -- rect: left=240 top=82 right=104 bottom=271
  789. -- title width / last selected line: 0
  790. -- icon id / first selected line: 29517 / 29517
  791. -- text alignment: 1
  792. -- font id: 0
  793. -- text size: 12
  794. -- style flags: 0
  795. -- line height: 16
  796. -- part name: and subsets
  797. ----- HyperTalk script -----
  798. on mouseUp
  799.   -- intersection (Boolean AND) subsets
  800.   checkOpenDatabase
  801.   if (getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty or getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty) then
  802.     beep
  803.     answer "Sorry, subset not open!"
  804.     exit to HyperCard
  805.   end if
  806.   if clickedOnLeftHalf() then
  807.     get zbrowser ("ANDSUBSETS", getSubsetHandle(1), getSubsetHandle(2))
  808.     browseIndex1
  809.     if field "SearchPattern1" is not empty then
  810.       if the number of words in field "SearchPattern2" > 1 then
  811.         put " and (" & field "SearchPattern2" & ")" after field "SearchPattern1"
  812.       else
  813.         put " and " & field "SearchPattern2" after field "SearchPattern1"
  814.       end if
  815.     end if
  816.   else
  817.     get zbrowser ("ANDSUBSETS", getSubsetHandle(2), getSubsetHandle(1))
  818.     browseIndex2
  819.     if field "SearchPattern2" is not empty then
  820.       if the number of words in field "SearchPattern1" > 1 then
  821.         put " and (" & field "SearchPattern1" & ")" after field "SearchPattern2"
  822.       else
  823.         put " and " & field "SearchPattern1" after field "SearchPattern2"
  824.       end if
  825.     end if
  826.   end if
  827. end mouseUp
  828.  
  829.  
  830.  
  831.  
  832. -- part 21 (button)
  833. -- low flags: 80
  834. -- high flags: 0000
  835. -- rect: left=257 top=20 right=42 bottom=279
  836. -- title width / last selected line: 0
  837. -- icon id / first selected line: 29513 / 29513
  838. -- text alignment: 1
  839. -- font id: 0
  840. -- text size: 12
  841. -- style flags: 0
  842. -- line height: 16
  843. -- part name: fill subset 2
  844. ----- HyperTalk script -----
  845. on mouseUp
  846.   -- fill the subset associated with Index field #2
  847.   checkOpenDatabase
  848.   if not (getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty) then
  849.     get zbrowser ("RELEASESUBSET", getSubsetHandle(2))
  850.     setSubsetHandle 2,0
  851.   end if
  852.   browseIndex2
  853.   hide field "searchPattern2"
  854.   hide bg button "and subsets"
  855.   hide bg button "or subsets"
  856.   hide bg button "not subset 2"
  857.   hide bg button "fill subset 2"
  858. end mouseUp
  859.  
  860.  
  861.  
  862.  
  863. -- part 22 (button)
  864. -- low flags: 80
  865. -- high flags: 0000
  866. -- rect: left=257 top=40 right=62 bottom=279
  867. -- title width / last selected line: 0
  868. -- icon id / first selected line: 29515 / 29515
  869. -- text alignment: 1
  870. -- font id: 0
  871. -- text size: 12
  872. -- style flags: 0
  873. -- line height: 16
  874. -- part name: not subset 2
  875. ----- HyperTalk script -----
  876. on mouseUp
  877.   -- invert the subset associated with Index field #2
  878.   checkOpenDatabase
  879.   if (getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty) then
  880.     beep
  881.     answer "Sorry, subset not open!"
  882.     exit to HyperCard
  883.   else
  884.     get zbrowser ("BOOLEANNOTSUBSET", getSubsetHandle(2))
  885.   end if
  886.   browseIndex2
  887.   if the number of words in field "SearchPattern2" > 1 then
  888.     put "not (" before field "SearchPattern2"
  889.     put ")" after field "SearchPattern2"
  890.   else
  891.     put "not " before field "SearchPattern2"
  892.   end if
  893.   show field "SearchPattern2"
  894. end mouseUp
  895.  
  896.  
  897.  
  898.  
  899. -- part 29 (button)
  900. -- low flags: 00
  901. -- high flags: 2002
  902. -- rect: left=216 top=88 right=104 bottom=233
  903. -- title width / last selected line: 0
  904. -- icon id / first selected line: 20407 / 20407
  905. -- text alignment: 1
  906. -- font id: 0
  907. -- text size: 12
  908. -- style flags: 0
  909. -- line height: 16
  910. -- part name: scrollDownIndex1
  911. ----- HyperTalk script -----
  912. on mouseDown
  913.   global indexLines
  914.   checkOpenDatabase
  915.   if line indexLines of field Index1 is empty then
  916.     beep
  917.     exit mouseDown
  918.   end if
  919.   setWordNum1 (getWordNum1() + 1)
  920.   browseIndex1
  921. end mouseDown
  922.  
  923. on mouseStillDown
  924.   global indexLines
  925.   if line indexLines of field Index1 is empty then
  926.     beep
  927.     exit mouseStillDown
  928.   end if
  929.   setWordNum1 (getWordNum1() + 2)
  930.   browseIndex1
  931. end mouseStillDown
  932.  
  933.  
  934.  
  935. -- part 37 (button)
  936. -- low flags: 00
  937. -- high flags: 2002
  938. -- rect: left=495 top=104 right=120 bottom=512
  939. -- title width / last selected line: 0
  940. -- icon id / first selected line: 24019 / 24019
  941. -- text alignment: 1
  942. -- font id: 0
  943. -- text size: 12
  944. -- style flags: 0
  945. -- line height: 16
  946. -- part name: scrollUpContext
  947. ----- HyperTalk script -----
  948. on mouseDown
  949.   checkOpenDatabase
  950.   if line 1 of field Context is empty then exit mouseDown
  951.   browseContext 2
  952.   setInstanceNum getTextPtrListInstanceItem (1)
  953. end mouseDown
  954.  
  955. on mouseStillDown
  956.   if line 1 of field Context is empty then exit mouseStillDown
  957.   browseContext 3
  958.   setInstanceNum getTextPtrListInstanceItem (1)
  959. end mouseStillDown
  960.  
  961.  
  962.  
  963. -- part 42 (button)
  964. -- low flags: 00
  965. -- high flags: 2002
  966. -- rect: left=496 top=142 right=158 bottom=512
  967. -- title width / last selected line: 0
  968. -- icon id / first selected line: 15717 / 15717
  969. -- text alignment: 1
  970. -- font id: 0
  971. -- text size: 12
  972. -- style flags: 0
  973. -- line height: 16
  974. -- part name: jumpContext
  975. ----- HyperTalk script -----
  976. on mouseUp
  977.   checkOpenDatabase
  978.   ask "Instances (+/-) to jump?"
  979.   lock screen
  980.   setInstanceNum (It + getInstanceNum())
  981.   browseContext 1
  982. end mouseUp
  983.  
  984.  
  985.  
  986.  
  987. -- part 40 (button)
  988. -- low flags: 00
  989. -- high flags: 2002
  990. -- rect: left=495 top=173 right=189 bottom=512
  991. -- title width / last selected line: 0
  992. -- icon id / first selected line: 20407 / 20407
  993. -- text alignment: 1
  994. -- font id: 0
  995. -- text size: 12
  996. -- style flags: 0
  997. -- line height: 16
  998. -- part name: scrollDownContext
  999. ----- HyperTalk script -----
  1000. on mouseDown
  1001.   global contextLines
  1002.   checkOpenDatabase
  1003.   if line contextLines of field Context is empty then exit mouseDown
  1004.   setInstanceNum getTextPtrListInstanceItem (contextLines)
  1005.   browseContext contextLines-1
  1006.   setInstanceNum getTextPtrListInstanceItem (1)
  1007. end mouseDown
  1008.  
  1009. on mouseStillDown
  1010.   global contextLines
  1011.   if line contextLines of field Context is empty then exit mouseStillDown
  1012.   setInstanceNum getTextPtrListInstanceItem (contextLines)
  1013.   browseContext contextLines-2
  1014.   setInstanceNum getTextPtrListInstanceItem (1)
  1015. end mouseStillDown
  1016.  
  1017.  
  1018.  
  1019. -- part 41 (button)
  1020. -- low flags: 00
  1021. -- high flags: 0000
  1022. -- rect: left=333 top=0 right=20 bottom=365
  1023. -- title width / last selected line: 0
  1024. -- icon id / first selected line: 29531 / 29531
  1025. -- text alignment: 1
  1026. -- font id: 3
  1027. -- text size: 9
  1028. -- style flags: 256
  1029. -- line height: 12
  1030. -- part name: Open
  1031. ----- HyperTalk script -----
  1032. on mouseUp
  1033.   global indexLines
  1034.   closeDatabase -- close out any open files first
  1035.   get openCloseFiles ( ) -- put up dialog box to pick database
  1036.   if It is empty then exit to HyperCard -- quit if user chooses 'Cancel'
  1037.   if char 1 of It is "{" then -- display error msg if necessary
  1038.     answer It
  1039.     exit mouseUp
  1040.   end if
  1041.   put line 2 of It into field "database name"
  1042.   set cursor to watch
  1043.   lock screen
  1044.   setTextFileRefNum(word 1 of It) -- store returned refNum values
  1045.   setKeyFileRefNum(word 2 of It)
  1046.   setPtrFileRefNum(word 3 of It)
  1047.   setNeighborhoodSize 48 -- initialize neighborhood for proximity search
  1048.   setSubsetHandle 1,0 -- initialize subsets to empty
  1049.   setSubsetHandle 2,0
  1050.   setWordNum1 (line 1 of zbrowser("LOCATE", "A", getKeyFileRefNum()))
  1051.   if getWordNum1() < 0 then setWordNum1(0)
  1052.   setWordNum2 (line 1 of zbrowser("LOCATE", "Z", getKeyFileRefNum()))
  1053.   if getWordNum2() < 0 then setWordNum2(0)
  1054.   browseIndex1 -- load index windows
  1055.   browseIndex2
  1056.   setInstanceNum(getInstanceList1item (1))
  1057.   browseContext 1
  1058. end mouseUp
  1059.  
  1060.  
  1061.  
  1062. -- part 44 (button)
  1063. -- low flags: 00
  1064. -- high flags: 0000
  1065. -- rect: left=492 top=0 right=20 bottom=512
  1066. -- title width / last selected line: 0
  1067. -- icon id / first selected line: 29520 / 29520
  1068. -- text alignment: 1
  1069. -- font id: 3
  1070. -- text size: 9
  1071. -- style flags: 256
  1072. -- line height: 12
  1073. -- part name: Zoom/Shrink
  1074. ----- HyperTalk script -----
  1075. on mouseUp
  1076.   get the SelectedChunk
  1077.   if the height of field Text < 175 then
  1078.     set the rect of field Text to 0,19,512,342
  1079.   else
  1080.     set the rect of field Text to 0,189,512,342
  1081.   end if
  1082.   select It
  1083. end mouseUp
  1084.  
  1085.  
  1086.  
  1087. -- part 5 (field)
  1088. -- low flags: 00
  1089. -- high flags: 0007
  1090. -- rect: left=0 top=189 right=342 bottom=512
  1091. -- title width / last selected line: 0
  1092. -- icon id / first selected line: 0 / 0
  1093. -- text alignment: 0
  1094. -- font id: 4
  1095. -- text size: 9
  1096. -- style flags: 0
  1097. -- line height: 12
  1098. -- part name: Text
  1099.  
  1100.  
  1101. -- part 45 (field)
  1102. -- low flags: 81
  1103. -- high flags: 0004
  1104. -- rect: left=0 top=265 right=340 bottom=233
  1105. -- title width / last selected line: 0
  1106. -- icon id / first selected line: 0 / 0
  1107. -- text alignment: 0
  1108. -- font id: 4
  1109. -- text size: 9
  1110. -- style flags: 0
  1111. -- line height: 12
  1112. -- part name: SearchPattern1
  1113. ----- HyperTalk script -----
  1114. on mouseUp
  1115.   hide field "SearchPattern1"
  1116. end mouseUp
  1117.  
  1118.  
  1119. -- part 46 (field)
  1120. -- low flags: 81
  1121. -- high flags: 0004
  1122. -- rect: left=279 top=265 right=340 bottom=512
  1123. -- title width / last selected line: 0
  1124. -- icon id / first selected line: 0 / 0
  1125. -- text alignment: 0
  1126. -- font id: 4
  1127. -- text size: 9
  1128. -- style flags: 0
  1129. -- line height: 12
  1130. -- part name: SearchPattern2
  1131. ----- HyperTalk script -----
  1132. on mouseUp
  1133.   hide field "SearchPattern2"
  1134. end mouseUp
  1135.  
  1136.  
  1137. -- part 47 (field)
  1138. -- low flags: 01
  1139. -- high flags: 0002
  1140. -- rect: left=19 top=1 right=16 bottom=192
  1141. -- title width / last selected line: 0
  1142. -- icon id / first selected line: 0 / 0
  1143. -- text alignment: 1
  1144. -- font id: 4
  1145. -- text size: 9
  1146. -- style flags: 0
  1147. -- line height: 12
  1148. -- part name: database name
  1149.  
  1150.  
  1151. -- part 48 (button)
  1152. -- low flags: 00
  1153. -- high flags: 0000
  1154. -- rect: left=198 top=0 right=20 bottom=216
  1155. -- title width / last selected line: 0
  1156. -- icon id / first selected line: 16451 / 16451
  1157. -- text alignment: 1
  1158. -- font id: 0
  1159. -- text size: 12
  1160. -- style flags: 0
  1161. -- line height: 16
  1162. -- part name: find selection 1
  1163. ----- HyperTalk script -----
  1164. on mouseUp
  1165.   set cursor to watch
  1166.   checkOpenDatabase
  1167.   put word 1 of the selection into theSel
  1168.   if theSel is empty then
  1169.     beep
  1170.     answer "Please highlight a word before clicking."
  1171.     exit mouseUp
  1172.   end if
  1173.   setWordNum1 (line 1 of zbrowser("LOCATE", theSel, getKeyFileRefNum()))
  1174.   if getWordNum1() < 0 then setWordNum1(0)
  1175.   browseIndex1
  1176.   if the height of field "Text" > 169 then
  1177.     send mouseUp to bg button id 44
  1178.   end if
  1179. end mouseUp
  1180.  
  1181.  
  1182. -- part 49 (button)
  1183. -- low flags: 00
  1184. -- high flags: 0000
  1185. -- rect: left=294 top=0 right=20 bottom=312
  1186. -- title width / last selected line: 0
  1187. -- icon id / first selected line: 16451 / 16451
  1188. -- text alignment: 1
  1189. -- font id: 0
  1190. -- text size: 12
  1191. -- style flags: 0
  1192. -- line height: 16
  1193. -- part name: find selection 2
  1194. ----- HyperTalk script -----
  1195. on mouseUp
  1196.   set cursor to watch
  1197.   checkOpenDatabase
  1198.   put word 1 of the selection into theSel
  1199.   if theSel is empty then
  1200.     beep
  1201.     answer "Please highlight a word before clicking."
  1202.     exit mouseUp
  1203.   end if
  1204.   setWordNum2 (line 1 of zbrowser("LOCATE", theSel, getKeyFileRefNum()))
  1205.   if getWordNum2() < 0 then setWordNum2(0)
  1206.   browseIndex2
  1207.   if the height of field "Text" > 169 then
  1208.     send mouseUp to bg button id 44
  1209.   end if
  1210. end mouseUp
  1211.  
  1212.  
  1213. -- part 50 (button)
  1214. -- low flags: 00
  1215. -- high flags: 0000
  1216. -- rect: left=457 top=0 right=18 bottom=475
  1217. -- title width / last selected line: 0
  1218. -- icon id / first selected line: 29711 / 29711
  1219. -- text alignment: 1
  1220. -- font id: 0
  1221. -- text size: 12
  1222. -- style flags: 0
  1223. -- line height: 16
  1224. -- part name: move up in text
  1225. ----- HyperTalk script -----
  1226. on mouseUp
  1227.   global textChunkSize
  1228.   set cursor to watch
  1229.   checkOpenDatabase
  1230.   if getTextStart() is 0 then
  1231.     beep
  1232.     answer "Already at beginning of database!"
  1233.     exit mouseUp
  1234.   end if
  1235.   get zbrowser ("TEXT", getTextStart() - 1, textChunkSize, textChunkSize, getTextFileRefNum())
  1236.   put number of lines of It into textItemLines
  1237.   put line 1 to (textItemLines-1) of It into field "Text"
  1238.   put line textItemLines of It into textLastLine
  1239.   setTextStart (word 1 of textLastLine)
  1240.   setTextTarget (word 2 of textLastLine)
  1241.   setTextEnd (word 3 of textLastLine)
  1242.   select char getTextEnd() to getTextEnd() - 1 of field "Text"
  1243. end mouseUp
  1244.  
  1245.  
  1246.  
  1247.  
  1248. -- part 51 (button)
  1249. -- low flags: 00
  1250. -- high flags: 0000
  1251. -- rect: left=474 top=0 right=18 bottom=492
  1252. -- title width / last selected line: 0
  1253. -- icon id / first selected line: 29712 / 29712
  1254. -- text alignment: 1
  1255. -- font id: 0
  1256. -- text size: 12
  1257. -- style flags: 0
  1258. -- line height: 16
  1259. -- part name: move down in text
  1260. ----- HyperTalk script -----
  1261. on mouseUp
  1262.   global textChunkSize
  1263.   set cursor to watch
  1264.   checkOpenDatabase
  1265.   if last line of field "Text" is "{end of database}" then
  1266.     beep
  1267.     answer "Already at end of database!"
  1268.     exit mouseUp
  1269.   end if
  1270.   get zbrowser ("TEXT", getTextEnd(), textChunkSize, 1, getTextFileRefNum())
  1271.   put number of lines of It into textItemLines
  1272.   put line 1 to (textItemLines-1) of It into field "Text"
  1273.   put line textItemLines of It into textLastLine
  1274.   setTextStart (word 1 of textLastLine)
  1275.   setTextTarget (word 2 of textLastLine)
  1276.   setTextEnd (word 3 of textLastLine)
  1277.   select char 1 to 0 of field "Text"
  1278. end mouseUp
  1279.  
  1280.  
  1281.  
  1282.  
  1283. -- part 56 (button)
  1284. -- low flags: 00
  1285. -- high flags: 0000
  1286. -- rect: left=383 top=0 right=19 bottom=403
  1287. -- title width / last selected line: 0
  1288. -- icon id / first selected line: 15420 / 15420
  1289. -- text alignment: 1
  1290. -- font id: 0
  1291. -- text size: 12
  1292. -- style flags: 0
  1293. -- line height: 16
  1294. -- part name: Prev
  1295. ----- HyperTalk script -----
  1296. on mouseUp
  1297.   visual effect wipe right
  1298.   go to previous card
  1299. end mouseUp
  1300.  
  1301.  
  1302. -- part 57 (button)
  1303. -- low flags: 00
  1304. -- high flags: 0000
  1305. -- rect: left=404 top=0 right=19 bottom=424
  1306. -- title width / last selected line: 0
  1307. -- icon id / first selected line: 16560 / 16560
  1308. -- text alignment: 1
  1309. -- font id: 0
  1310. -- text size: 12
  1311. -- style flags: 0
  1312. -- line height: 16
  1313. -- part name: Next
  1314. ----- HyperTalk script -----
  1315. on mouseUp
  1316.   visual effect wipe left
  1317.   go to next card
  1318. end mouseUp
  1319.  
  1320.  
  1321. -- part 59 (button)
  1322. -- low flags: 00
  1323. -- high flags: 0000
  1324. -- rect: left=434 top=3 right=16 bottom=448
  1325. -- title width / last selected line: 0
  1326. -- icon id / first selected line: 1018 / 1018
  1327. -- text alignment: 1
  1328. -- font id: 3
  1329. -- text size: 9
  1330. -- style flags: 0
  1331. -- line height: 12
  1332. -- part name: notes
  1333. ----- HyperTalk script -----
  1334. on mouseUp
  1335.   push card
  1336.   go to card id 3713
  1337. end mouseUp
  1338.  
  1339.  
  1340.